import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'

Vue.config.productionTip = false

// 样式
import "./assets/css/reset.css"
//公共组件
import "./components/index"
//过滤器
import "./filters/index"

import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';
Vue.use(ElementUI)

//守卫
router.beforeEach((to,from,next)=>{
  if(to.path=="/login"){
    next()
    return
  }
  if(sessionStorage.getItem("user")){
    next()
    return
  }
  next("/login")
})

new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')
